package thinkingJava.chapter17;

public class DequeTest {
	static void fillTest(Deque<Integer> deque) {
		for (int i = 0; i < 27; i ++) {
			deque.addFirst(i);
		}
		for (int i = 50 ; i < 55 ; i ++) {
			deque.addLast(i);
		}
	}
	public static void main(String[] args) {
		Deque<Integer> deque = new Deque<Integer>();
		fillTest(deque);
		print(deque);
		while (deque.size() != 0) {
			printnb(deque.removeFirst() + "_");
		}
		print("");
		fillTest(deque);
		while(deque.size() != 0) {
			printnb(deque.removeLast() + "_");
		}
	}
	public static void print(Object o) {
		System.out.println(o);
	}
	public static void printnb(Object o) {
		System.out.print(o);
	}
}
